from pathlib import Path
from typing import TypedDict
def is_file(path:Path):
    return path.is_file() and path.exists()

def ensure_file(path:Path):
    if not is_file(path):
        raise FileNotFoundError(f"File {path.resolve()} does not exist.")